<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <title>ai设置</title>
    <div th:replace="admin/_fragments-admin::basicrefrence"></div>
</head>


<!--网页主体-->
<body>

<!--网页头-->
<nav th:replace="admin/_fragments-admin::nav"></nav>
<div th:replace="admin/_fragments-admin::Seconednav"></div>


<div class="m-tenDistance">
    <div class="ui container">
        <div class="ui segment">

            <div  class="ui input">
                <input id="addId" type="text" placeholder="输入放行的id">
            </div>

            <div class="ui selection dropdown">
                <input type="hidden" id="grade">
                <i class="dropdown icon"></i>
                <div class="default text">选择放行等级</div>
                <div class="menu">
                    <div class="item" data-value="1">一级</div>
                    <div class="item" data-value="2">二级</div>
                    <div class="item" data-value="3">无限制</div>
                </div>
            </div>

            <button class="ui inverted blue button" onclick="setGrade()">确认</button>

        </div>
    </div>
</div>


<footer th:replace="admin/_fragments-admin::footer"></footer>


</body>

<script type="text/javascript">

    $('.ui.dropdown').dropdown();

    function setGrade() {
        let grade = $("#grade").val();
        let addId = $("#addId").val();
        if(confirm("确认要放行" + addId +"为等级" + grade +"吗?")){
            $.ajax({
                url:"/admin/aiSetting/idGradeSetting",
                data:{
                    id:addId,
                    grade:grade
                } ,
                success:function (resp) {
                    alert(resp.data);
                }
            });
        }
    }



</script>

</html>